<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS盒子模型</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        /* body{
            display: flex;
            justify-content: center;
        } */
        div{
            width: 50px;
            height: 50px;
            background-color: blue;
            /* margin: 0 auto; */
            text-align: center;
            position: absolute;
            top: 50%;
            margin-top: -25px;
            padding: 20px;
            border: 2px solid black;
            margin: 10px;
        }
    </style>
</head>

<body>
    <div><span>123</span></div>
    
</body>

</html>